package com.atguigu.gulimall.order.service;

import com.atguigu.gulimall.order.vo.OrderConfirmVo;
import com.atguigu.gulimall.order.vo.OrderSubmitVo;
import com.atguigu.gulimall.order.vo.SubmitOrderResponseVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.order.entity.OrderEntity;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author laisanshan
 * @email fromzero911@gmail.com
 * @date 2021-07-12 16:50:50
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 获取订单确认页的数据
     *
     * @return 订单确认页
     */
    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    /**
     * 提交订单数据
     *
     * @param vo 订单表单
     * @return 订单响应
     */
    SubmitOrderResponseVo submitOrder(OrderSubmitVo vo);

    /**
     * 根据订单号查询订单
     *
     * @param orderSn 订单号
     * @return 订单
     */
    OrderEntity queryStatusByOrderSn(String orderSn);

    /**
     * 关单
     *
     * @param orderEntity 订单实体
     */
    void closeOrder(OrderEntity orderEntity);

    /**
     * 关闭订单
     *
     * @param orderSn 订单号
     */
    void closeByOrderSn(String orderSn);

}

